package com.cxcy.swustlearner.service.Impl;

import com.cxcy.swustlearner.mapper.RegisterMapper;
import com.cxcy.swustlearner.pojo.User;
import com.cxcy.swustlearner.service.RegisterService;
import com.cxcy.swustlearner.utils.idUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class RegisterServiceImpl implements RegisterService {
    @Autowired
    private RegisterMapper registerMapper;
    @Override
    public void register(User user) {
        user.setUid(idUtils.generateUniqueUserId());
        registerMapper.insertUser(user);
    }
}
